<?php

// +----------------------------------------------------------------------
// | 标签数据表
// +----------------------------------------------------------------------

namespace common\model;

use think\model\RelationModel;

/**
 * 标签关联Model
 */
class TagRelationModel extends RelationModel
{
    const RELATION_TYPE_DEMAND = 1; // 关联类型-需求
    const RELATION_TYPE_WORK_ORDER = 2; // 关联类型-工单
    const RELATION_TYPE_DELAY = 3; // 关联类型-延期
    const RELATION_TYPE_DELAY_STEP_CATEGORY_CONFIRM = 4; // 关联类型-延期环节确认
    const RELATION_TYPE_DELAY_PRODUCER_REJECT = 5; // 关联类型-延期制片拒绝
    const RELATION_TYPE_TASK_REPAIR = 6; // 关联类型-任务返修

    //自动验证
    protected $_validate = [
        ['relation_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],
        ['relation_type', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],
        ['created', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['created_by', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
    ];
}
